
#include "Public.h"
#include <stdio.h> 
//#include "main.h"
//#include "stm32f0xx.h"
//#include "OLED.h"
//#include "OLEDdelay.h"


    
int main(void)
{ 


  
  
  
  
  System_Initial();
  Data_Initial();             //数据初始化

//  check_reset_status();
//NVIC_SystemReset();

   USART1_Init();  //数据初始后才有波特率值
   USART2_Init(); 
   
   
  OLED_Init(); 

  u8display_cmd=1;//显示命令刷新全部



//---------------------正常开机------------------------ 


  while (1)
  {
    
     IWDG_ReloadCounter();    /*reload*/


     
     UART1_LINK();      //
     UART2_LINK();      //      

     JSON();
     

     IO_input();//io输入
     key();   //OK  
     
     logic();//主逻辑    
     
     output();//继电器
     BEEP();//蜂鸣器     
     
     LEDOut(LEDOUT_REG); //led发光二极管 
     
     OLED1(); //OLED显示    

     flash_data();  //eerom定时写入       



  }
}
      


#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{ 
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (0)
  {
  }
}
#endif

/**
  * @}
  */


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
